import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import User from '@/components/User'
import Department from '@/components/Department'

Vue.use(Router)
// import axios from "axios";
//配置axios的全局基本路径
axios.defaults.baseURL='https://www.fastmock.site/mock/bcf5677fa589576daed7671fdea0c6aa/pethome'

//全局属性配置，在任意组件内可以使用this.$http获取axios对象
Vue.prototype.$http = axios

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/user',
      name: 'User',
      component: User
    },
    {
      path: '/department',
      name: 'Department',
      component: Department
    }
  ]
})
